//
//  CashierNewSearchDataModel.m
//  TryShopping
//
//  Created by LiYinDi on 16/6/8.
//  Copyright © 2016年 RuiBen. All rights reserved.
//

#import "CashierNewSearchDataModel.h"

@implementation CashierNewSearchDataModel
+(instancetype)dataModelWithDict:(NSDictionary *)dict
{
    CashierNewSearchDataModel *dataModel=[[self alloc] init];
    dataModel.itemId=[Global getJudgeTheErrorStr:dict[@"itemId"]];
    dataModel.specId=[Global getJudgeTheErrorStr:dict[@"specId"]];
    dataModel.itemName=[Global getJudgeTheErrorStr:dict[@"itemName"]];
    dataModel.specName=[Global getJudgeTheErrorStr:dict[@"specName"]];
//    dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"dealPrice"]];
    
    if ([[Global getType] isEqualToString:@"NeedOrder"]) {//要货成本价
        NSString *str1=[NSString stringWithFormat:@"%d",TARGET_VERSION];
        if ([str1 isEqualToString:@"4"]) {
           
            dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"costPrice"]];
            
        }else{
        dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"dealPrice"]];
            
        }
        
    }else{
        
      
        dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"dealPrice"]];
        
    }

    
    dataModel.specInv=[Global getJudgeTheErrorStr:dict[@"specInv"]];
    dataModel.imageUrlFull=[Global getJudgeTheErrorStr:dict[@"imageUrl"]];
    
    
    return dataModel;

}
@end
